<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <!--
        v-bind 可以绑定属性
        
            除了class与style之外，一个属性被多次使用时，Vue2与Vue3有如下的区别
                Vue3: 后写的不会覆盖前面的
                Vue2: 后写的会覆盖前面的

    -->

    <div id="app">
        <h2>Vue3</h2>
        <!-- title="box1" class="c1 c2" -->
        <p title="box1" v-bind:title="curId" class="c1" :class="curClass">我的天</p>
        <!-- title="box2" -->
        <p v-bind:title="curId" title="box1" style="color: red" :style="{fontSize: '20px'}">我的地</p>
    </div>

    <div id="app-vue2">
        <h2>Vue2</h2>
        <!-- title="box2" class="c1 c2" -->
        <p title="box1" v-bind:title="curId" class="c1" :class="curClass">我的天</p>
        <!-- title="box1" -->
        <p v-bind:title="curId" title="box1">我的地</p>
    </div>

    <script type="module">
        import { createApp } from './lib/vue3.esm.browser.js'
        import Vue from './lib/vue2.esm.browser.js'


        createApp({
            data() {
                return {
                    curId: 'box2',
                    curClass: 'c2'
                }
            }
        }).mount('#app')


        new Vue({
            el: '#app-vue2',
            data() {
                return {
                    curId: 'box2',
                    curClass: 'c2'
                }
            }
        })
    </script>
</body>

</html>